<template>
    <div class="hello">
        <aaa></aaa>
        <input type="button" @click="tackPic()" value="拍照">
    </div>
</template>

<script>
    import aaa from './aaa.vue'
//    import Vue from 'vue'

    export default {
        name: 'HelloWorld',
        data () {
            return {
                msg: 'Welcome'
            }
        },
        components: {
            'aaa': aaa
        },
        mounted: function () {
        },
        methods: {
            tackPic: function () {
                let options = {
                    quality: 20,
                    destinationType: navigator.camera.DestinationType.FILE_URI,
                    encodingType: navigator.camera.EncodingType.JPEG,
                    mediaType: navigator.camera.MediaType.PICTURE
                }
//                navigator.camera.getPicture(this.onSuccess, this.onFail, options)
                navigator.camera.getPicture((imageURI) => {
                    alert('Photo URI : ' + imageURI)
                }, (message) => {
                    alert('FAILED : ' + message)
                }, options)
            }
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
    h1, h2 {
        font-weight: normal;
    }

    ul {
        list-style-type: none;
        padding: 0;
    }

    li {
        display: inline-block;
        margin: 0 10px;
    }

    a {
        color: #42b983;
    }
</style>
